<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="dist/vue.js"></script>
</head>

<body>
    <div id ="app"> 
        {{ sex | sexFilter }}
    </div>

    <script>
    // Vue.filter('sexFilter', val => val === 1 ?' 男': '女');
    Vue.filter('sexFilter', (val) => {
        return val === 1 ? '男' : '女';
    });
   
     var app = new Vue({
        el: '#app',
        data: {
            sex: 1
        },
     });
    </script>
</body>

</html>